varying highp vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
const lowp int GAUSSIAN_SAMPLES = 9;
varying highp vec2 blurCoordinates[GAUSSIAN_SAMPLES];
void main()
{
  highp vec4 sum = vec4(0.0);
  vec2 blurCoordinatesNew[GAUSSIAN_SAMPLES];
  float texOffset = 1.0 / 565.0; // 纹理一个像素的偏移量
  int multiplier = 0;
  vec2 blurStep;
  vec2 singleStepOffset = vec2(texOffset, texOffset);
  for (int i = 0; i < GAUSSIAN_SAMPLES; i++)
  {
      multiplier = (i - ((GAUSSIAN_SAMPLES - 1) / 2));
      blurStep = float(multiplier) * singleStepOffset;
      blurCoordinatesNew[i] = textureCoordinate.xy + blurStep;
  }
  blurCoordinatesNew[0] = textureCoordinate.xy - vec2(texOffset, texOffset);
  blurCoordinatesNew[1] = textureCoordinate.xy - vec2(0, texOffset);
  blurCoordinatesNew[2] = textureCoordinate.xy + vec2(texOffset, -texOffset);
  blurCoordinatesNew[3] = textureCoordinate.xy - vec2(texOffset, 0);
  blurCoordinatesNew[4] = textureCoordinate.xy;
  blurCoordinatesNew[5] = textureCoordinate.xy + vec2(texOffset, 0);
  blurCoordinatesNew[6] = textureCoordinate.xy + vec2(-texOffset, texOffset);
  blurCoordinatesNew[7] = textureCoordinate.xy + vec2(0, texOffset);
  blurCoordinatesNew[8] = textureCoordinate.xy + vec2(texOffset, texOffset);
  sum += texture2D(inputImageTexture, blurCoordinatesNew[0]) * 0.0625f;
  sum += texture2D(inputImageTexture, blurCoordinatesNew[1]) * 0.125f;
  sum += texture2D(inputImageTexture, blurCoordinatesNew[2]) * 0.0625f;
  sum += texture2D(inputImageTexture, blurCoordinatesNew[3]) * 0.125f;
  sum += texture2D(inputImageTexture, blurCoordinatesNew[4]) * 0.125f;
  sum += texture2D(inputImageTexture, blurCoordinatesNew[5]) * 0.125f;
  sum += texture2D(inputImageTexture, blurCoordinatesNew[6]) * 0.0625f;
  sum += texture2D(inputImageTexture, blurCoordinatesNew[7]) * 0.125f;
  sum += texture2D(inputImageTexture, blurCoordinatesNew[8]) * 0.0625f;
  sum *= 1.0;
  gl_FragColor = sum;
}